//12．	使用es6正确实现只出现一次的数字函数
let arr:number[]=[1,1,2,2,3,3,4,4,5,5]
let brr:number[]=[]
function qc(arr:number[]){
      arr.forEach((item:number, index:number) => {
         if(!brr.includes(item)){
             brr.push(item)
         }
      })
      console.log(brr);
}
qc(arr);

class Money{
    sum:number
    constructor(sum:number){
        this.sum=sum
    }
    static add(one:Money,two:Money){
        const sum=(one.sum+two.sum).toString()
        return `${sum[0]}元 ${sum[1]}角`
    }
    add(two:Money){
        const sum=(one.sum+two.sum).toString()
        return `${sum[0]}元 ${sum[1]}角`
    }
    valueOf(){
         return this.sum
    }
    toString(){
        const sum=(one.sum+two.sum).toString()
        return `${sum[0]}元 ${sum[1]}角`
    }
}
let one:any=new Money(80)
let two:any=new Money(100)
let axx=Money.add(one,two)
let bxx=one.add(two)
let cxx=new Money(one+two)

console.log(`${axx},${bxx},${cxx}`);


let crr:number[]=[1,12,3,45,67]
let addZreo=function(crr:number[]){
    let drr=[]
    for (let index = 0; index < crr.length; index++) {
        if(crr[index]<10){
            drr.push("0"+crr[index])
        }else{
            drr.push(""+crr[index])
        }
    }
    return drr
}
console.log(addZreo(crr));
 